data1 = dlmread('output_matlab1') ;
data2 = dlmread('output_matlab2') ;

data = data1 + data2 ;
data = data / 2 ;

figure ;
plot(data(:,1), data(:,2), '-^b', data(:,1), data(:,3), '-or') ;
title('CPU versus basic CUDA implementation') ;
xlabel('n') ;
ylabel('Time(second)') ;
xlim([min(data(:,1)), max(data(:,1))]) ;
legend('CPU', 'Basic CUDA') ;
legend boxoff ;


figure ;
plot(data(:,1), data(:,3), '-or', data(:,1), data(:,4), '-^b', data(:,1), data(:,5), '-*g') ;
title('Basic CUDA, Basic CUDA with no transpose, CUDA with shared memory') ;
xlabel('n') ;
ylabel('Time(second)') ;
xlim([min(data(:,1)), max(data(:,1))]) ;
legend('Basic CUDA', 'Basic CUDA with no transpose', 'CUDA with shared memory') ;
legend boxoff ;


figure ;
plot(data(:,1), data(:,5), '-*g', data(:,1), data(:,6), '-xb', data(:,1), data(:,7), '-vm') ;
title('CUDA with shared memory, CUDA with coalesce and bank conflict elimination, CUBLAS syrk') ;
xlabel('n') ;
ylabel('Time(second)') ;
xlim([min(data(:,1)), max(data(:,1))]) ;
legend('CUDA with shared memory', 'CUDA with coalesce and bank conflict elimination', 'CUBLAS syrk') ;
legend boxoff ;
